<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>欢迎</title>
</head>
<body>
<div>
    <span id="email"></span>欢迎登录系统
</div>

</body>

<script src="jquery-1.9.1.min.js"></script>
<script>
    $(function () {
        welcome.init();
    });

    let welcome = {
        init:function () {
            $.ajax({
                url:'/api/user/getUserInfo',
                type:'post',
                dataType:'json',
                success:function(data) {
                    if (data.code == 200) {
                        $('#email').text(data.data.email);
                    } else if (data.code == 400){
                        window.location = "/static/login.html";
                    }
                }
            });
        }
    }
</script>
</html>